package com.my.junit.controller;

import com.my.junit.domain.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Zijian Liao
 * @since 1.0.0
 */
@RequestMapping("/foo")
@RestController
public class FooController {

    @GetMapping
    public User getUser(String name){
        return new User(name);
    }

    @PostMapping
    public boolean save(@RequestBody User user){
        return true;
    }

}
